<template>
    <div class="product-main" @click="click" ref="card">
        <div class="product-main-card">
            <el-image ref="image" class="btn-img" fit="cover" :src="item.url"/>
            <div class="title">
                <div class="title-main">{{item.title}}</div>
            </div>
        </div>
    </div>
</template>

<script>
    export default {
        name: "product-item",
        props: {
            item: {
                type: Object,
                default: () => ({})
            },
        },
        methods: {
            click() {
                this.$emit('click')
            },
        },
    }
</script>

<style scoped lang="scss">
    .product-main {
        width: 100%;
        border: 1px #cbcbcb solid;
        cursor: pointer;
    }

    .product-main:hover .title {
        height: 100px;
        transition: 1s;
    }

    .product-main-card {
        margin: 20px;
        position: relative;

        .btn-img {
            width: 100%;
            height: 100%;
        }
    }

    .title {
        position: absolute;
        width: 100%;
        border-top: 3px darkorange solid;
        height: 30px;
        bottom: 0px;
        background: white;
        transition: 1s;

        &-main {
            font-size: 16px;
            font-weight: normal;
            margin: 2px 0 0;
            text-transform: uppercase;
            text-align: left;
        }
    }
</style>